package com.gxa.web_admin.controller.lx;

import com.gxa.common.vo.R2;
import com.gxa.modules.service.lx.GoodsManageService;
import com.gxa.modules.service.lx.GoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@Api(value = "商品管理",tags = "商品管理")
@RequestMapping("/goodsManage")
public class GoodsManageController {
    @Autowired(required = false)
    private GoodsManageService goodsManageService;

    @RequestMapping(value = "/queryShopGoods",method = RequestMethod.POST)
    @ApiOperation(value = "店铺商品查询接口",notes = "店铺商品查询", response = R2.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R2 queryShopGoods(@RequestBody Map map) {

        return goodsManageService.queryShopGoods(map);
    }

    @RequestMapping(value = "/editBasicInfo",method = RequestMethod.POST)
    @ApiOperation(value = "编辑商品基本信息接口",notes = "编辑商品基本信息", response = R2.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R2 editBasicInfo(@RequestBody Map map) {

        return goodsManageService.editBasicInfo(map);
    }

    @RequestMapping(value = "/editPriceInfo",method = RequestMethod.POST)
    @ApiOperation(value = "编辑商品价格信息接口",notes = "编辑商品价格信息", response = R2.class)
    @ApiResponses({
            @ApiResponse(code=200,message="请求成功"),
            @ApiResponse(code=404,message="找不到页面"),
            @ApiResponse(code=500,message="后台服务错误")
    })
    @ResponseBody
    public R2 editPriceInfo(@RequestBody Map map) {

        return goodsManageService.editPriceInfo(map);

    }

}
